package com.boot.springboot.component.helper.controller;

import com.boot.springboot.component.helper.service.BiInfoHelper;
import com.boot.springboot.component.helper.service.BiInfoHelper2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

/**
 * @author luowenjie
 * @since 2021/12/17 17:29
 */
@RestController
@RequestMapping("/helper")
public class HelperController {

    @Autowired
    BiInfoHelper helper;

    @Autowired
    BiInfoHelper2 helper2;

    @RequestMapping(value = "/get", method = RequestMethod.GET)
    public String get() {
        String text = helper2.getBiInfo("111");
        return text;
    }

    @RequestMapping(value = "/set", method = RequestMethod.POST)
    public String set(@RequestParam String id) {

        //String text = helper.getBiInfo("111");
        HashMap<String, String> biInfoHashMap = new HashMap<>();
        biInfoHashMap.put("111",id);
        helper2.setBiInfoMap(biInfoHashMap);
        return id;
    }

}
